package com.changdu.seatunnel.admin.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@ConfigurationProperties(prefix = "seatunnel.query")
public class SeatunnelQueryProperty {

	private String type;
	
	private String baseurl;
	
	private String token;
	
	private ScheduledConfig scheduled = new ScheduledConfig();	
	
	private DingRobotConfig ding = new DingRobotConfig();
	
    @Data
    @NoArgsConstructor
    public static class ScheduledConfig {

        private long taskScan = 3600L;
        
        private boolean enabled = true;
        
        private long maxlag = 500000;
        
    }
    
    @Data
    @NoArgsConstructor
    public static class DingRobotConfig {
    	
    	private String url;
    	
    	private String title = "Seatunnel巡检告警";
    	
    	private String content = """
    				所在集群: %s
    				任务ID: %s
    				任务名称: %s
    				任务状态：%s
    				数据延迟: %s
    			""";
    	
    }
	
}
